﻿<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="renderer" content="webkit|ie-comp|ie-stand">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
        <meta http-equiv="Cache-Control" content="no-siteapp" />
        <!--[if lt IE 9]>
        <script type="text/javascript" src="__STATIC__/admin/hui/lib/html5shiv.js"></script>
        <script type="text/javascript" src="__STATIC__/admin/hui/lib/respond.min.js"></script>
        <![endif]-->
        <link rel="stylesheet" type="text/css" href="__STATIC__/admin/hui/static/h-ui/css/H-ui.min.css" />
        <link rel="stylesheet" type="text/css" href="__STATIC__/admin/hui/static/h-ui.admin/css/H-ui.admin.css" />
        <link rel="stylesheet" type="text/css" href="__STATIC__/admin/hui/lib/Hui-iconfont/1.0.8/iconfont.css" />
        <link rel="stylesheet" type="text/css" href="__STATIC__/admin/hui/static/h-ui.admin/skin/default/skin.css" id="skin" />
        <link rel="stylesheet" type="text/css" href="__STATIC__/admin/hui/static/h-ui.admin/css/style.css" />
        <!--[if IE 6]>
        <script type="text/javascript" src="__STATIC__/admin/hui/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
        <script>DD_belatedPNG.fix('*');</script>
        <![endif]-->
        <title>商户信息</title>
    </head>
    <body>
        <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 账户管理 <span class="c-gray en">&gt;</span> 商户信息 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
        <div class="page-container">
            <div class="col-sm-5 pd-20 radius" style="border: 1px solid #ccc;border-radius: 10px;box-shadow:2px 2px 5px #d3d6da;">
                <form class="form form-horizontal" id="form-password-change">
                    <div id="tab_demo" class="HuiTab">
                        <div class="tabBar clearfix">
                            <span class="radius">银行</span>
                            <!--<span class="radius">支付宝</span>-->
                        </div>
                        <div class="row cl">
                            <label class="form-label col-xs-4 col-sm-2"> 提款帐号：</label>
                            <div class="formControls col-xs-8 col-sm-9">
                                <input type="text" class="input-text" value="" placeholder="右方，可提现账户列表中的账户号" id="account" name="account">
                            </div>
                        </div>
                        
                        <!--银行-->
                        <div class="tabCon">
                            <div class="row cl">
                                <label class="form-label col-xs-4 col-sm-2"> 银行名称：</label>
                                <div class="formControls col-xs-8 col-sm-9">
                                    <span class="select-box">
                                        <select class="select" size="1" name="bankName">
                                            <option value="" selected>选择银行</option>
                                            {foreach name="bank" item="vo" key="k"}
                                            <option value="{$vo.bank_code}">{$vo.bank_name}</option>
                                            {/foreach}
                                        </select>
                                    </span>
                                </div>
                            </div>
                            <div class="row cl">
                                <label class="form-label col-xs-4 col-sm-2"> 省份：</label>
                                <div class="formControls col-xs-8 col-sm-9">
                                    <span class="select-box">
                                        <select class="select" size="1" name="provinceCode" onchange="provinceChange(this)">
                                            <option value="" selected>选择省份</option>
                                            {foreach name="province" item="vo" key="k"}
                                            <option value="{$vo.code}">{$vo.name}</option>
                                            {/foreach}
                                        </select>
                                    </span>
                                </div>
                            </div>
                            <div class="row cl">
                                <label class="form-label col-xs-4 col-sm-2"> 城市：</label>
                                <div class="formControls col-xs-8 col-sm-9">
                                    <span class="select-box">
                                        <select class="select" size="1" id="city" name="cityCode">
                                            <option value="" selected>请先选择省份</option>
                                        </select>
                                    </span>
                                </div>
                            </div>
                            <div class="row cl">
                                <label class="form-label col-xs-4 col-sm-2"> 银行卡号：</label>
                                <div class="formControls col-xs-8 col-sm-9">
                                    <input type="text" class="input-text" value="" placeholder="收款卡号" id="bankCard" name="bankCard">
                                </div>
                            </div>
                            <div class="row cl">
                                <label class="form-label col-xs-4 col-sm-2"> 银行卡户主：</label>
                                <div class="formControls col-xs-8 col-sm-9">
                                    <input type="text" class="input-text" value="" placeholder="银行卡开户人" id="ownerName" name="ownerName">
                                </div>
                            </div>
                        </div>

                        <!--支付宝-->
<!--                        <div class="tabCon">
                            <div class="row cl">
                                <label class="form-label col-xs-4 col-sm-2"> 银行名称：</label>
                                <div class="formControls col-xs-8 col-sm-9">
                                    <span class="select-box">
                                        <select class="select" size="1" name="bankName" disabled>
                                            <option value="ZFBS1" selected>支付宝</option>
                                        </select>
                                    </span>
                                </div>
                            </div>
                            <div class="row cl">
                                <label class="form-label col-xs-4 col-sm-2"> 支付宝帐号：</label>
                                <div class="formControls col-xs-8 col-sm-9">
                                    <input type="text" class="input-text" value="" placeholder="支付宝帐号" id="bankCard" name="bankCard">
                                </div>
                            </div>
                            <div class="row cl">
                                <label class="form-label col-xs-4 col-sm-2"> 收款人：</label>
                                <div class="formControls col-xs-8 col-sm-9">
                                    <input type="text" class="input-text" value="" placeholder="支付宝收款人" id="ownerName" name="ownerName">
                                </div>
                            </div>
                        </div>-->

                        <div class="row cl">
                            <label class="form-label col-xs-4 col-sm-2"> 金额 / 元：</label>
                            <div class="formControls col-xs-8 col-sm-9">
                                <input type="text" class="input-text" value="" placeholder="最多两位小数" id="amount" name="amount">
                            </div>
                        </div>
                        <div class="row cl">
                            <label class="form-label col-xs-4 col-sm-2"> 支付密码：</label>
                            <div class="formControls col-xs-8 col-sm-9">
                                <input type="password" class="input-text" value="" placeholder="管理员提供的密钥" id="password" name="password">
                            </div>
                        </div>
                        <div class="row cl">
                            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                                <input class="btn btn-primary radius Hui-iconfont" type="submit" value="&#xe632; 提交">
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="col-sm-4 ml-20 pd-20 radius" style="border: 1px solid #ccc;border-radius: 10px;box-shadow:2px 2px 5px #d3d6da;">
                <div class="tabBar cl mb-15">
                    <span class="radius">账户信息</span>
                </div>
                <table class="table table-border table-bordered table-bg table-striped table-hover radius">
                    <thead class="text-c">
                        <tr>
                            <th width="100">余额</th><th width="100">冻结余额</th><th width="100">剩余可使用手续费</th><th width="100">代付代发费用</th>
                        </tr>
                    </thead>
                    <tbody class="text-c">
                        <tr>
                            <th>{$info.amount} 元</th><th>{$info.djamount} 元</th><th>{$info.mchnt_pre_fee} 元</th><th>{$info.total_daifu_fee} 元/笔</th>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <!--_footer 作为公共模版分离出去-->
        <script type="text/javascript" src="__STATIC__/admin/hui/lib/jquery/1.9.1/jquery.min.js"></script> 
        <script type="text/javascript" src="__STATIC__/admin/hui/lib/layer/2.4/layer.js"></script>
        <script type="text/javascript" src="__STATIC__/admin/hui/static/h-ui/js/H-ui.min.js"></script> 
        <script type="text/javascript" src="__STATIC__/admin/hui/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

        <!--请在下方写此页面业务相关的脚本-->
        <script type="text/javascript" src="__STATIC__/admin/hui/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
        <script type="text/javascript" src="__STATIC__/admin/hui/lib/jquery.validation/1.14.0/validate-methods.js"></script>
        <script type="text/javascript" src="__STATIC__/admin/hui/lib/jquery.validation/1.14.0/messages_zh.js"></script>
        <script type="text/javascript" src="__STATIC__/admin/hui/lib/jquery/1.9.1/jquery.md5.js"></script> 
        <script>
            //选项卡
            jQuery.Huitab = function (tabBar, tabCon, class_name, tabEvent, i) {
                var $tab_menu = $(tabBar);
                // 初始化操作
                $tab_menu.removeClass(class_name);
                $(tabBar).eq(i).addClass(class_name);
                $(tabCon).hide();
                $(tabCon).eq(i).show();

                $tab_menu.bind(tabEvent, function () {
                    $tab_menu.removeClass(class_name);
                    $(this).addClass(class_name);
                    var index = $tab_menu.index(this);
                    $(tabCon).hide();
                    $(tabCon).eq(index).show()
                })
            }
            
            //city列表
            function provinceChange(obj){
                $.ajax({
                    url:"{:url('merchant/city')}",
                    type:'get',
                    data:{'id':$(obj).val()},
                    dataType:'json',
                    success:function(res){
                        $('#city').empty().append(res);
                    }
                });
            }

            //自定义validate验证输入的数字小数点位数不能大于两位
            jQuery.validator.addMethod("minNumber", function (value, element) {
                var returnVal = true;
                inputZ = value;
                var ArrMen = inputZ.split(".");    //截取字符串
                if (ArrMen.length == 2) {
                    if (ArrMen[1].length > 2) {    //判断小数点后面的字符串长度
                        returnVal = false;
                        return false;
                    }
                }
                return returnVal;
            }, "小数点后最多为两位");         //验证错误信息

            $(function () {
                $.Huitab("#tab_demo .tabBar span", "#tab_demo .tabCon", "current", "click", "0");

                $("#form-password-change").validate({
                    rules: {
                        name: {
                            required: true
                        },
                        amount: {
                            required: true,
                            number: true,
                            min: 0.01,
                            minNumber: $("#amount").val()
                        }
                    },
                    onkeyup: false,
                    focusCleanup: true,
                    success: "valid",
                    submitHandler: function (form) {
                        $(form).ajaxSubmit({
                            type: 'post',
                            url: "{:url('merchant/info')}",
                            success: function (data) {
//                                    alert(data);
                                layer.msg(data, {icon: 1, time: 3000}, function () {
                                    location.reload();
                                });
                            },
                            error: function (XmlHttpRequest, textStatus, errorThrown) {
                                layer.msg('error!', {icon: 1, time: 3000});
                            }
                        });
                    }
                });
            });
        </script>
    </body>
</html>